package com.ruoyi.shop.modules.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.shop.nosql.es.domain.EsProductAttributeValue;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 商品信息对象 prd_product
 *
 * @author zjc
 * @date 2024-06-22
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class Product extends BaseEntity {
    private static final long serialVersionUID = 1L;
    private Long id;
    @Excel(name = "商品分类id")
    private Long productCategoryId;
    @Excel(name = "运费模板id")
    private Long feightTemplateId;
    @Excel(name = "商品属性分类id")
    private Long productAttributeCategoryId;
    @Excel(name = "品牌id")
    private Long productBrandId;
    @Excel(name = "商品名称")
    private String name;
    @Excel(name = "封面")
    private String pic;
    @Excel(name = "货号")
    private String productSn;
    @Excel(name = "删除状态")
    private Integer deleteStatus;
    @Excel(name = "上架状态")
    private Integer publishStatus;
    @Excel(name = "新品状态")
    private Integer newStatus;
    @Excel(name = "推荐状态")
    private Integer recommandStatus;
    @Excel(name = "审核状态")
    private Integer verifyStatus;
    @Excel(name = "排序")
    private Long sort;
    @Excel(name = "销量")
    private Long sale;
    @Excel(name = "原价")
    private BigDecimal price;
    @Excel(name = "促销价格")
    private BigDecimal promotionPrice;
    @Excel(name = "赠送成长值")
    private Long giftGrowth;
    @Excel(name = "赠送积分")
    private Long giftPoint;
    @Excel(name = "限制使用积分数")
    private Long usePointLimit;
    @Excel(name = "副标题")
    private String subTitle;
    @Excel(name = "商品描述")
    private String description;
    @Excel(name = "库存")
    private Long stock;
    @Excel(name = "库存预警值")
    private Long lowStock;
    @Excel(name = "单位")
    private String unit;
    @Excel(name = "商品重量")
    private BigDecimal weight;
    @Excel(name = "是否为预购商品")
    private Long previewStatus;
    @Excel(name = "产品服务")
    private String serviceIds;
    private String keywords;
    @Excel(name = "画册图片")
    private String albumPics;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "促销开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date promotionStartTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "促销结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date promotionEndTime;
    @Excel(name = "限购数量")
    private Integer promotionPerLimit;
    @Excel(name = "促销类型")
    private Integer promotionType;
    @Excel(name = "品牌名称")
    private String brandName;
    @Excel(name = "商品分类名称")
    private String productCategoryName;
    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("productCategoryId", getProductCategoryId())
                .append("feightTemplateId", getFeightTemplateId())
                .append("productAttributeCategoryId", getProductAttributeCategoryId())
                .append("productBrandId", getProductBrandId())
                .append("name", getName())
                .append("pic", getPic())
                .append("productSn", getProductSn())
                .append("deleteStatus", getDeleteStatus())
                .append("publishStatus", getPublishStatus())
                .append("newStatus", getNewStatus())
                .append("recommandStatus", getRecommandStatus())
                .append("verifyStatus", getVerifyStatus())
                .append("sort", getSort())
                .append("sale", getSale())
                .append("price", getPrice())
                .append("promotionPrice", getPromotionPrice())
                .append("giftGrowth", getGiftGrowth())
                .append("giftPoint", getGiftPoint())
                .append("usePointLimit", getUsePointLimit())
                .append("subTitle", getSubTitle())
                .append("description", getDescription())
                .append("stock", getStock())
                .append("lowStock", getLowStock())
                .append("unit", getUnit())
                .append("weight", getWeight())
                .append("previewStatus", getPreviewStatus())
                .append("serviceIds", getServiceIds())
                .append("keywords", getKeywords())
                .append("albumPics", getAlbumPics())
                .append("promotionStartTime", getPromotionStartTime())
                .append("promotionEndTime", getPromotionEndTime())
                .append("promotionPerLimit", getPromotionPerLimit())
                .append("promotionType", getPromotionType())
                .append("brandName", getBrandName())
                .append("productCategoryName", getProductCategoryName())
                .toString();
    }
}
